package Tests.figuren;

import java.util.ArrayList;


import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import schach.server.model.Brett;
import schach.server.model.Dame;
import schach.server.model.Feld;
import schach.server.model.Figur;

public class DameTest {

	private static ArrayList<ArrayList<Feld>> felder;
	private ArrayList<Feld> crossed;
	private Figur figur;

	@BeforeClass
	public static void firstSetUp() {
		Brett brett = new Brett();
		felder = brett.getFelder();

	}

	@Before
	public void setUp() {
		Feld feld = felder.get(0).get(1);
		figur = new Dame(feld, true, true);
		feld.setFigur(figur);
		System.out.println(figur.getPosition().toString());
		crossed = new ArrayList<Feld>();

	}

	@Test
	public void testeTurm() {
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8; j++) {
				try {
					crossed = figur.crossedFields(felder.get(i).get(j));
					figur.move(felder.get(i).get(j));
					System.out.println(felder.get(i).get(j).toString()
							+ " korrekt");
				} catch (Exception e) {
					System.out.println("Error");
				}
			}
		}

	}
}